package de.koller.aframe.util.web.basicHTML;

import de.koller.aframe.util.web.basicHTML.HTMLPage;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

abstract public class HTMLFile extends HTMLPage {
	
	private final String file;
	
	public HTMLFile( String file ) {
		super( null );
		this.file = file;
	}	

	public final void save() {
		try {
			File f = new File( file );
			OutputStream out = new FileOutputStream( f );
			
			this.printHTTP = false;
			this.print( out, "" );
			out.close();
		} catch( IOException ex ) {
			System.err.println( ex );
		}
	}
	
	@Override
	public final boolean isRequestValid( String request ) {
		return true;
	}
	
}
